<!doctype html>
<html>
<head>
  <title>Learning jQuery</title>
  <meta charset="utf-8" />
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/themes/smoothness/jquery-ui.css" />
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js"></script>
  <style>
    #square {
      width:200px;
      height:200px;
      background-color:grey;
    }

    #target {
      width:300px;
      height:300px;
      background-color:yellow;
    }
  </style>
</head>

<body>
  <div id="square"></div>

  <div id="target"></div>

  <script type="text/javascript">
    $("#square").draggable();
    $("#target").droppable({
        drop:function(ui,event) {
          $(this).css("background-color","red");
        }
    });
  </script>
</body>
</html>
